package job.tracker.domain

import java.util.List;

class JobSite {

	JobSiteApprovalStatusEnum approvalStatus = JobSiteApprovalStatusEnum.PENDING
	String dataElement 							// identifier for page content div#cats-and-jobs
	String jobSelector 							// selects each job
	Date lastSyncDateTime
	Date pageLastChanged
	Map postDataParams

	// ==== user entered ====
	String pageUrl								// http://etc
	String name 								// caribbean jobs it
	String description 	= ''					// jobs for IT personel arround the caribbean
	List<Job> jobs

	static hasMany = [
		jobs : Job
	]

	static constraints = {
		dataElement 			(blank: false, nullable: false)
		jobSelector 			(blank: false, nullable: false)
		approvalStatus 			(nullable: false)
		//FIXME: pageUrl 		(unique: true, url: true, blank: false, nullable: false, minSize: 'http://1.co'.size())
		pageUrl 				(blank: false)
		name 					(blank: false, nullable: false, minSize: 3)
		description 			(blank: true, nullable: false)
		lastSyncDateTime 		(nullable: true)
		pageLastChanged			(nullable: true)
		postDataParams			(nullable: true)
	}
}
